package com.cms.content.problem.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.content.problem.dao.ProblemCatDAO;
import com.cms.content.problem.pojo.ProblemCat;
import com.cms.content.problem.service.ProblemCatService;
@Service
public class ProblemCatServiceImpl implements ProblemCatService {
	@Autowired
	ProblemCatDAO problemCatDAO;
	@Override
	public boolean saveProblemCat(ProblemCat problemCat) {
		if(problemCat.getId()==null){
			return problemCatDAO.insert(problemCat)>0;
		}else{
			return problemCatDAO.updateByPrimaryKey(problemCat)>0;
		}
	}

	@Override
	public boolean deleteByCatId(Integer catId) {
		return problemCatDAO.deleteByPrimaryKey(catId)>0;
	}

	@Override
	public ProblemCat findByCatId(Integer catId) {
		return problemCatDAO.selectByPrimaryKey(catId);
	}

	@Override
	public List<ProblemCat> findList() {
		// TODO Auto-generated method stub
		return null;
	}

}
